package com.upbos.upm.common.cat;

import com.upbos.core.ret.RetData;
import com.upbos.upm.entity.Category;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <b>Application name：</b> DictController.java <br>
 * <b>Application describing: 配置数据字典</b> <br>
 * <b>Copyright：</b> Copyright &copy; 2015-2017 myzh.com 版权所有。<br>
 * <b>Company：</b> myzh.com <br>
 * <b>Date：</b> 2017年10月18日 17:09 <br>
 * <b>author：</b> <a href="mailto:wjzchina2008@126.com"> Jason </a>
 * <b>version：</b>V3.0.0
 *
 * @author wangjz
 */
@RestController
@RequestMapping("upm")
public class CategoryController {

    /**
     * 通用服务类
     */
    @Resource
    private CategoryService categoryService;

    @RequestMapping("common/listCategory")
    public RetData listCategory(Integer type) {
        return RetData.success(categoryService.listCategory(type));
    }

    @RequestMapping("insertCategory")
    public void insertCategory(Category category) {
        categoryService.insertCategory(category);
    }

    @RequestMapping("deleteCategory")
    public void deleteCategory(Long id) {
        categoryService.deleteCategory(id);
    }

}